package com.yyp.car.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.yyp.car.Iservice.ICarTypeService;
import com.yyp.car.Iservice.IGroundService;
import com.yyp.car.Iservice.ISchoolService;
import com.yyp.car.Iservice.ITeacherService;
import com.yyp.car.model.School;

@Controller
public class MainController {
	@Resource(name="schoolService")
	private ISchoolService schoolService;
	@Resource(name="groundService")
	private IGroundService groundService;
	@Resource(name="teacherService")
	private ITeacherService teacherService;
	@Resource(name="carTypeService")
	private ICarTypeService carTypeService;
	@RequestMapping({"/","/index"})
	public String index(){
		return "login";
	}
	@RequestMapping(value="/stIndex",method=RequestMethod.GET)
	public String studentIndex(){
		return "index/index";
	}
	@RequestMapping(value="/studentRegister",method=RequestMethod.GET)
	public ModelAndView mangerRoles(){
		List<School> schools=schoolService.listSchool();
		ModelAndView ma=new ModelAndView("/ajaxViews/studentRegister");
		ma.addObject("schools", schools);
		return ma;
	}
}
